/**
 * 
 */
package com.alphasystem.commerce.common;

import java.io.Serializable;

/**
 * @author sali
 * 
 */
public abstract class ApplicationCode implements Serializable {

	private static final long serialVersionUID = -5582381852299218106L;

	protected String code;

	public ApplicationCode() {
	}

	public ApplicationCode(String code) {
		this.code = code;
	}

	public boolean equals(Object o) {
		System.out.println("######   ApplicationCode.equals() : " + this
				+ "  :  " + o);
		if (o == null || !(o instanceof ApplicationCode)) {
			return false;
		}
		ApplicationCode c = (ApplicationCode) o;
		if (this.code == null && c.getCode() == null) {
			return true;
		}
		return (this.code != null && this.code.equals(c.getCode()));
	}

	public String getCode() {
		return code;
	}

	public int hashCode() {
		if (code == null) {
			return 0;
		}
		return code.hashCode();
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String toString() {
		return code;
	}

}
